import { asyncRoutes } from '@/router'
const state = {
  routes: []
}
const actions = {
  filterRoutes(store, menus) {
    const result = asyncRoutes.filter(item => menus.includes(item.name))
    store.commit('setRoute', result)
    return result
  }
}
const mutations = {
  setRoute(state, value) {
    state.routes = value
  }
}
export default {
  namespaced: true,
  state, actions, mutations
}
